<template>
	<view class="page">
		<c-nav-bar :title="titleHeader" ></c-nav-bar>
		<view class="tabs">
			<u-tabs lineWidth='50' lineHeight='8' :list="list" @click="click" :scrollable='false'
				activeStyle="{color: #007A69;}"></u-tabs>

		</view>
		<view class="contain">
			<view class="main" v-for="(item,index) in noticeList" :key="index" @tap='handleDetail(item)'>
				<view class="top">

					{{item.title}}
				</view>
				<view class="time">
					发布时间：{{item.releaseTime}}
				</view>

			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				titleHeader:'公告信息',
				list: [{
					name: '航运通知',

				}, {
					name: '其他信息',
				}],
				noticeList: []
			}
		},
		onLoad() {
			this.getNoticePage(0)
		},
		methods: {
			get() {},
			handleDetail(item) {
				uni.navigateTo({
					url: "/pagesIndex/notice/detail?noticeId=" + item.id
				})
			},
			click(item) {
				this.getNoticePage(item.index)
			},
			getNoticePage(type) {
				this.$api.get('/api/notice/noticePage', {
					limit: 10,
					page: 1,
					type
				}).then(res => {
					if (res.data.code == 0) {
						this.noticeList = res.data.data.list
					}

				})
			}
		}
	}
</script>

<style lang="scss">
	.page {
		height: 100vh;
		background: #F5F8FA;
		padding-top: 130rpx;
	}

	.tabs {
		height: 86rpx;
		background: #fff;
		width: 100%;

	}

	.contain {

		padding: 20rpx;

		.main {
			margin-bottom: 20rpx;
			padding: 20rpx;
			background: #fff;
			display: flex;
			flex-direction: column;
			justify-content: space-evenly;
			border-radius: 16rpx;
			height: 121rpx;

			.top {
				overflow: hidden;
				white-space: nowrap;
				text-overflow: ellipsis;
				height: 42rpx;
				font-size: 30rpx;
				font-weight: 500;
				color: #333333;
				line-height: 42rpx;
			}

			.time {
				width: 100%;
				font-size: 24rpx;
				font-family: PingFang SC, PingFang SC;
				font-weight: 400;
				color: #999999;

			}
		}
	}
</style>